<template>
	<view class="page-body" :class="[app.setCStyle(from)]">
		<view class="list-cell b-b " @click="app.goPage('editInfo?from='+from)" hover-class="cell-hover" :hover-stay-time="50">
			<view class="smll">
				<u-icon name="/static/public/images/personal_icon_person.png" class="mr20" size="48"></u-icon>
				<text class="cell-tit">个人资料</text>
			</view>
			<view class="cell-more">编缉<u-icon name="arrow-right ml20" :size="20"></u-icon>
			</view>
		</view>
		<view class="list-cell b-b " @click="app.goPage('editPassWord?from='+from)" hover-class="cell-hover" :hover-stay-time="50">
			<view class="smll">
				<u-icon name="/static/public/images/personal_icon_safe.png" class="mr20" size="48"></u-icon>
				<text class="cell-tit">帐户安全</text>
			</view>
			<view class="cell-more">修改密码<u-icon name="arrow-right ml20" :size="20"></u-icon>
			</view>
		</view>
		<!-- <view class="list-cell" @click="app.goPage('checkIdCard?from='+from)" hover-class="cell-hover" :hover-stay-time="50">
			<view class="smll">
				<u-icon name="/static/public/images/personal_icon_id.png" class="mr20" size="48"></u-icon>
				<text class="cell-tit">实名认证</text>
			</view>
			<view class="cell-more" v-if="userInfo.check_id_card == 0">未认证<u-icon name="arrow-right ml20" :size="20"></u-icon>
			</view>
			<view class="cell-more" v-if="userInfo.check_id_card == 1">已认证<u-icon name="arrow-right ml20":size="20"></u-icon>
			</view>
			<view class="cell-more" v-if="userInfo.check_id_card == 2">审核中<u-icon name="arrow-right ml20" :size="20"></u-icon>
			</view>
			<view class="cell-more red" v-if="userInfo.check_id_card == 3">认证失败<u-icon name="arrow-right ml20" :size="20"></u-icon>
			</view>
		</view> -->
		<view class="mt20">
			<view class="list-cell b-b" @click="app.goPage('editReceivePay?from='+from)" hover-class="cell-hover"
			 :hover-stay-time="50">
				<view class="smll">
					<u-icon name="/static/public/images/personal_icon_date.png" class="mr20" size="48"></u-icon>
					<text class="cell-tit">收款信息</text>
				</view>
				<view class="cell-more">
					<u-icon name="arrow-right" :size="20"></u-icon>
				</view>
			</view>
			<view class="list-cell b-b" @click="app.goPage('/pages/member/address/list?from='+from)" hover-class="cell-hover"
			 :hover-stay-time="50">
				<view class="smll">
					<u-icon name="/static/public/images/personal_icon_where.png" class="mr20" size="48"></u-icon>
					<text class="cell-tit">地址管理</text>
				</view>
				<view class="cell-more">
					<u-icon name="arrow-right" :size="20"></u-icon>
				</view>
			</view>
		</view>
		<view class="p20 mt40">
			<button size="default" shape="circle" type="warning" class="fs32 primarybtn"  @click="toLogout">退出登录</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				from: '',
				userInfo: {}
			};
		},
		onLoad(options) {
			this.getUserInfo();
			this.from = options.from;
		},
		computed: {},
		onReady() {},
		methods: {
			getUserInfo() {
				//获取登录会员信息
				this.$u.api.getUserInfo().then(res => {
					this.userInfo = res.data;
				});
			},
			//退出登录
			toLogout() {
				uni.showModal({
					content: '确定要退出登录么?',
					success: (e) => {
						if (e.confirm) {
							this.app.delAuthCode(); //清除本地登陆缓存
							this.$u.post('member/api.passport/logout').then(res => {});
							let url = '/pages/shop/index/index';
							// if (this.from == 'channel') {
							// 	url = '/pagesB/channel/passport/login';
							// }
							uni.redirectTo({
								url: url
							});
						}
					}
				});
			},
		}
	}
</script>

<style lang='scss'>
	.list-cell {
		justify-content: space-between;
	}

	.cell-tit {
		font-size: 28rpx;
	}

	.cell-more {
		font-size: 28rpx;
		color: $font-color-gray;
	}
</style>
